package com.yz.pay.mq;

import com.yz.common.constant.MQConstants;
import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * Created With IntelliJ IDEA.
 * Descriptions:
 * <p>
 * User:Mr.Du
 * Date:2024/4/9
 * Time:13:44
 */
@Component
public class OrderMessageProducer {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendMessage(String message){
        rabbitTemplate.convertAndSend(MQConstants.ORDER_EXCHANGE_NAME, MQConstants.ORDER_ROUTING_KEY, message);
    }
}
